namespace (typescript)
方法は2つ
namespaceを使う
code:ts
namespace Foo {
export type Bar = string;
}
import *を使う
code:Foo.ts
export type Bar = string;
code:ts
import type * as Foo from "./Foo";
Effect-TSでは、index.tsでexport * asを使ってる
code:effect/src/index.ts
export * as Either from "./Either.js"
code:effect/src/Either.ts
export type Either<A, E = never> = Left<E, A> | Right<E, A>
export const TypeId: unique symbol = either.TypeId
https://zenn.dev/uhyo/articles/ts-namespace-2023
名前空間
https://zenn.dev/qnighy/articles/9c4ce0f1b68350
https://qiita.com/yuki153/items/a51878ad6a1ce913af48